<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/12/26 0026
  Time: 17:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<head>
    <title>服务标签</title>
</head>
<body>
<script>
    var productserveLabelList="${productserveLabelList}";
    if(productserveLabelList.length){
        productserveLabelList = productserveLabelList.substring(1,productserveLabelList.length-1).split(",");
        productserveLabelList.map(function(ele,index){
            $("#ProductServeLabel input[value='"+ele.trim()+"']").attr("checked","checked");
        });
    }

    function checkProductServeLabel(){
        progressLoad();
        $.ajax({
            cache: true,
            type: "POST",
            url:"${path }/product/editProductServeLabel.do",
            data:$('#ProductServeLabel').serialize(),// 你的formid
            async: false,
            error: function(request) {
                progressClose();
                $.messager.alert("删除失败", "服务器连接失败!","error");
            },
            success: function(data) {
                progressClose();
                if (data.success) {
                    $.messager.alert("系统提示", "操作成功","info",function(){
                        closeWin('editProductServeLabel')
                        reloadSellerDataGrid();
                    });

                }else{
                    progressClose();
                    $.messager.alert("系统提示", data.msg,"error");
                }
            }
        });
    }

</script>
<form id="ProductServeLabel" action="">

    <table  border="1" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td colspan="2"><p style="color: red">*此标签根据商家拥有的服务标签加载</p></td>
        </tr>
        <c:forEach var="sl"   items="${serveLabelList}"   >
            <tr>
                <td width="10%" style="text-align: center"><input type="checkbox" name="serveLabelList" value="${sl.id}_${sl.ord}"></td><td style="padding: 10px">${sl.name}</td>
            </tr>
        </c:forEach>
    </table>
    <input type="hidden" value="${product.id}" id="productId " name="productId">
</form>
</div>

<div  data-options="region:'south',border:true" style="height: 24px; padding-top: 8px;text-align: center" >
    <a  class="easyui-linkbutton" icon="icon-save" onclick="checkProductServeLabel();" >保存</a>
    <a class="easyui-linkbutton" icon="icon-cancel" onclick="closeWin('editProductServeLabel')" >取消</a>
</div>
</body>
</html>
